const http = require("http");
const io = require('socket.io');

let httpServer = http.createServer();

httpServer.listen(8080);

let wsServer = io.listen(httpServer);
wsServer.on('connection',sock=>{
    //on 接收 emit 发送
    sock.on('aaa',function(a,b,c){
        console.log(a,b,c);
    })
    setInterval(function(){
        sock.emit('ser',(new Date()).getTime())
    },3000);
});